package com.greate.rabbit.springbootrabbitmqdemo.hello;


import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
// 监听 hello 队列 没有这个队列就创建,默认是持久化
@RabbitListener(queuesToDeclare = @Queue("hello"))
public class HelloCustomer {

	/**
	 * 接收消息
	 */
	@RabbitHandler
	public void receiver(String message) {
		System.out.println(message);
	}

}
